package com.gxa.modules.communityManagement.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gxa.modules.communityManagement.form.BuildingManagementForm;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

@Data
@NoArgsConstructor
@TableName("p_building_management")
public class BuildingManagement implements Serializable {
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;
    @TableField("building_name")
    private String buildingName;
    @TableField("house_use")
    private String houseUse;
    @TableField("completion_date")
    private Date completionDate;
    @TableField("units_number")
    private Integer unitsNumber;
    @TableField("number_floors")
    private Integer numberFloors;
    private String note;
    @TableField("building_area")
    private Integer buildingArea;
    @TableField("community_id")
    private Integer communityId;

    public BuildingManagement(BuildingManagementForm buildingManagementForm) {
        this.id = buildingManagementForm.getId();
        this.buildingName = buildingManagementForm.getBuildingName();
        this.houseUse = buildingManagementForm.getHouseUse();
        this.completionDate = buildingManagementForm.getCompletionDate();
        this.unitsNumber = buildingManagementForm.getUnitsNumber();
        this.numberFloors = buildingManagementForm.getNumberFloors();
        this.note = buildingManagementForm.getNote();
        this.buildingArea = buildingManagementForm.getBuildingArea();
        this.communityId = buildingManagementForm.getCommunityId();
    }
}
